<template>
    <div>
        <!-- <h1>头部</h1> -->
        <el-row class="el-row">
            <el-col :span="6" :offset="6">
                <el-input placeholder="请输入数据" v-model="title"></el-input>
            </el-col>
            <el-col :span="3">
                <el-button type="success" @click="addItem">添加数据</el-button>
            </el-col>
        </el-row>
    </div>
</template>

<script lang="ts">
import { defineComponent,ref } from 'vue';

export default defineComponent({
    setup (props,{emit}) {
        const title = ref<string>('');
        console.log(title);
        const addItem = () =>{
            emit('add',title.value);
        };
        

        return {
            title,
            addItem,
        }
    }
})
</script>

<style scoped>

</style>